import Vue from 'vue'
import VueRouter from 'vue-router'
// import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'login',
    component: () => import('../views/user/login.vue'),
  },
  {
    path: '/home',
    name: 'home',
    component: () => import('../views/home.vue'),
    redirect: '/userList',
    children: [
      {
        path: '/userList',
        name: 'userList',
        meta: {
          title: '用户管理',
          icon: 'el-icon-user-solid',
          names: '用户列表'
        },
        component: () => import('../views/userManage/userList.vue')
      },
      {
        path: '/houseList',
        name: 'houseList',
        meta: {
          title: '房屋管理',
          icon: 'el-icon-s-goods',
          names: '房屋列表'
        },
        component: () => import('../views/houseManage/houseList.vue')
      }
    ]
  },

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
